package com.example.scanfast.application;

import android.app.Application;

import androidx.room.Room;

import com.example.scanfast.bean.FileBean;
import com.example.scanfast.database.FileDataBase;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class MyApplication extends Application {


    private static MyApplication myApplication;

    //声明一个数据库对象
    private FileDataBase fileDataBase;

    //声明一个路径
    private List<String> pathList=new ArrayList<>();


    //创建一个单例
    public static MyApplication getInstance(){
        return myApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        myApplication=this;
        fileDataBase= Room.databaseBuilder(this, FileDataBase.class,"file")
                .build();
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }


    public FileDataBase getFileDataBase(){
        return fileDataBase;
    }
}
